#!/usr/bin/python

from icgi import html

print html.header("text/html")

print html.start_html({
  "title":"icgi test page",
  "lang":"en-GB",
  "stylesheet":"test.css"})

out = html.h1({},"Test of icgi") 
out += html.p({"class":"normaltext"},"hello this is a paragraph")
out += html.p({"id":"test"},"this is a paragraph with id=test")
out += html.start_form({"method":"get","action":"test.cgi","name":"testform"})


options = { 1:"one",2:"two",3:"three" }

out += html.table({},
  html.tr({},
    html.th({},"Number") +
    html.td({}, html.form_select({"name":"number"},options=options,selected=2) ) 
    ) +
  html.tr({},
    html.th({},"Comment") +
    html.td({}, html.form_textbox({"name":"comment","value":"I like python"}) )
    ) +
  html.tr({},
    html.td({"colspan":2}, html.form_submit({"value":"Submit Me"}) ) )
  )


out += html.end_form()

print out
print html.end_html()

